package com.pl.controller;

import com.pl.service.VideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.xml.soap.SOAPException;
import java.net.ConnectException;
import java.net.MalformedURLException;
import java.util.Map;

/**
 * @author shent
 */
@RestController
@RequestMapping("video")
public class VideoController {

    @Autowired
    VideoService videoService;

    @GetMapping("/{deviceId}")
    public Map<String, Object> getUrl(@PathVariable("deviceId") Long deviceId) throws ConnectException, SOAPException, MalformedURLException {
        return videoService.getUrl(deviceId);
    }
}
